Skip to content

fix: make platformCustomerId optional in Kotlin sample#348

Merged
shreyav merged 1 commit intomainfrom
docs/sync-20260417
Apr 17, 2026
Merged

fix: make platformCustomerId optional in Kotlin sample#348
shreyav merged 1 commit intomainfrom
docs/sync-20260417

Conversation

@claude
Copy link
Copy Markdown
Contributor

@claude claude Bot commented Apr 17, 2026

Summary

Context

The schema change in #345 made platformCustomerId optional on customer creation (if not provided, one is auto-generated). The Mintlify docs were updated in that same PR, but the Kotlin sample still used requireText() which would throw an error if the field was missing.

Test plan

  • Verify Kotlin sample compiles
  • Test customer creation without platformCustomerId in request body

🤖 Generated with Claude Code

Sync Kotlin sample with schema change from #345. The field is now
optional with auto-generation when not provided.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@claude claude Bot requested review from pengying and shreyav April 17, 2026 08:40
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
grid-flow-builder Ready Ready Preview, Comment Apr 17, 2026 8:40am

Request Review

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 17, 2026

Greptile Summary

Syncs the Kotlin sample with the schema change from #345 by making platformCustomerId optional on customer creation — if omitted, the API auto-generates one. The unused requireText import is also cleaned up.

Confidence Score: 5/5

Safe to merge — minimal, targeted fix with no logic concerns.

Single-file change that correctly adapts to the schema update from #345. The optional pattern used (optText + let) is consistent with every other optional field in the same file. No new issues introduced.

No files require special attention.

Important Files Changed

Filename Overview
samples/kotlin/src/main/kotlin/com/grid/sample/routes/Customers.kt Moves platformCustomerId into the optional apply block using optText + let, matching the schema change in #345; removes now-unused requireText import.

Sequence Diagram

sequenceDiagram
    participant Client
    participant KtorRoute as Kotlin Sample (POST /api/customers)
    participant GridAPI as Grid API

    Client->>KtorRoute: POST /api/customers { fullName, ... }
    Note over KtorRoute: platformCustomerId is optional
    alt platformCustomerId present in body
        KtorRoute->>KtorRoute: optText("platformCustomerId")?.let { platformCustomerId(it) }
    else platformCustomerId absent
        KtorRoute->>KtorRoute: field skipped — API will auto-generate
    end
    KtorRoute->>GridAPI: customers().create(params)
    GridAPI-->>KtorRoute: Customer (with auto or provided ID)
    KtorRoute-->>Client: 201 Created (customer JSON)
Loading

Reviews (1): Last reviewed commit: "fix: make platformCustomerId optional in..." | Re-trigger Greptile

@shreyav shreyav merged commit a79ac8b into main Apr 17, 2026
8 checks passed
@shreyav shreyav deleted the docs/sync-20260417 branch April 17, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant